package logic

import (
	"context"
	"user_srv/models/mysql"

	"user_srv/internal/svc"
	"user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type PositionDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewPositionDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PositionDelLogic {
	return &PositionDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 职位删除
func (l *PositionDelLogic) PositionDel(in *user.PositionDelRequest) (*user.PositionDelResponse, error) {
	// todo: add your logic here and delete this line

	mysql.DB.Debug().Where("id = ?", in.Id).Delete(&mysql.Position{})

	return &user.PositionDelResponse{}, nil
}
